home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / devtools / automake-1.0.tar.gz / automake-1.0.tar / automake-1.0 / aclocal.m4 next >
Text File  |  1996-05-15  |  3KB  |  106 lines

  1. # Local additions to Autoconf macros.
  2. # Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
  3. # Franτois Pinard <pinard@iro.umontreal.ca>, 1992.
  4.  
  5. ## ------------------------------- ##
  6. ## Check for function prototypes.  ##
  7. ## ------------------------------- ##
  8.  
  9. AC_DEFUN(fp_C_PROTOTYPES,
  10. [AC_REQUIRE([fp_PROG_CC_STDC])
  11. AC_MSG_CHECKING([for function prototypes])
  12. if test "$ac_cv_prog_cc_stdc" != no; then
  13.   AC_MSG_RESULT(yes)
  14.   AC_DEFINE(PROTOTYPES)
  15.   U= ANSI2KNR=
  16. else
  17.   AC_MSG_RESULT(no)
  18.   U=_ ANSI2KNR=./ansi2knr
  19. fi
  20. AC_SUBST(U)dnl
  21. AC_SUBST(ANSI2KNR)dnl
  22. ])
  23.  
  24. ## ----------------------------------------- ##
  25. ## ANSIfy the C compiler whenever possible.  ##
  26. ## ----------------------------------------- ##
  27.  
  28. # @defmac AC_PROG_CC_STDC
  29. # @maindex PROG_CC_STDC
  30. # @ovindex CC
  31. # If the C compiler in not in ANSI C mode by default, try to add an option
  32. # to output variable @code{CC} to make it so.  This macro tries various
  33. # options that select ANSI C on some system or another.  It considers the
  34. # compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
  35. # handles function prototypes correctly.
  36. #
  37. # If you use this macro, you should check after calling it whether the C
  38. # compiler has been set to accept ANSI C; if not, the shell variable
  39. # @code{ac_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
  40. # code in ANSI C, you can make an un-ANSIfied copy of it by using the
  41. # program @code{ansi2knr}, which comes with Ghostscript.
  42. # @end defmac
  43.  
  44. AC_DEFUN(fp_PROG_CC_STDC,
  45. [AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
  46. AC_CACHE_VAL(ac_cv_prog_cc_stdc,
  47. [ac_cv_prog_cc_stdc=no
  48. ac_save_CFLAGS="$CFLAGS"
  49. # Don't try gcc -ansi; that turns off useful extensions and
  50. # breaks some systems' header files.
  51. # AIX            -qlanglvl=ansi
  52. # Ultrix and OSF/1    -std1
  53. # HP-UX            -Aa -D_HPUX_SOURCE
  54. # SVR4            -Xc
  55. for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
  56. do
  57.   CFLAGS="$ac_save_CFLAGS $ac_arg"
  58.   AC_TRY_COMPILE(
  59. [#if !defined(__STDC__) || __STDC__ != 1
  60. choke me
  61. #endif
  62. ], [int test (int i, double x);
  63. struct s1 {int (*f) (int a);};
  64. struct s2 {int (*f) (double a);};],
  65. [ac_cv_prog_cc_stdc="$ac_arg"; break])
  66. done
  67. CFLAGS="$ac_save_CFLAGS"
  68. ])
  69. AC_MSG_RESULT($ac_cv_prog_cc_stdc)
  70. case "x$ac_cv_prog_cc_stdc" in
  71.   x|xno) ;;
  72.   *) CC="$CC $ac_cv_prog_cc_stdc" ;;
  73. esac
  74. ])
  75.  
  76. ## --------------------------------------------------------- ##
  77. ## Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
  78. ## substitution.                                             ##
  79. ## --------------------------------------------------------- ##
  80.  
  81. AC_DEFUN(fp_PROG_INSTALL,
  82. [AC_PROG_INSTALL
  83. test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
  84. AC_SUBST(INSTALL_SCRIPT)dnl
  85. ])
  86.  
  87.  
  88. # Add --enable-maintainer-mode option to configure.
  89. AC_DEFUN(jm_MAINTAINER_MODE,
  90. [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  91.   dnl maintainer-mode is disabled by default
  92.   AC_ARG_ENABLE(maintainer-mode,
  93. [  --enable-maintainer-mode enable make rules and dependencies not useful
  94.                           (and sometimes confusing) to the casual installer],
  95.       USE_MAINTAINER_MODE=$enableval,
  96.       USE_MAINTAINER_MODE=no)
  97.   AC_MSG_RESULT($USE_MAINTAINER_MODE)
  98.   if test $USE_MAINTAINER_MODE = yes; then
  99.     MAINT=
  100.   else
  101.     MAINT='#M#'
  102.   fi
  103.   AC_SUBST(MAINT)dnl
  104. ]
  105. )
  106.